﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DFGK_WMS.Context.Migrations
{
    public partial class 入库单详情表添加入库位置字段 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "FrontValue",
                table: "UnitOfMeasurementRules",
                newName: "frontValue");

            migrationBuilder.RenameColumn(
                name: "FrontUnitName",
                table: "UnitOfMeasurementRules",
                newName: "frontUnitName");

            migrationBuilder.RenameColumn(
                name: "FrontUnitId",
                table: "UnitOfMeasurementRules",
                newName: "frontUnitId");

            migrationBuilder.RenameColumn(
                name: "FrontUnitCode",
                table: "UnitOfMeasurementRules",
                newName: "frontUnitCode");

            migrationBuilder.RenameColumn(
                name: "AlertValue",
                table: "UnitOfMeasurementRules",
                newName: "alertValue");

            migrationBuilder.RenameColumn(
                name: "AlertUnitName",
                table: "UnitOfMeasurementRules",
                newName: "alertUnitName");

            migrationBuilder.RenameColumn(
                name: "AlertUnitId",
                table: "UnitOfMeasurementRules",
                newName: "alertUnitId");

            migrationBuilder.RenameColumn(
                name: "AlertUnitCode",
                table: "UnitOfMeasurementRules",
                newName: "alertUnitCode");

            migrationBuilder.RenameColumn(
                name: "Id",
                table: "UnitOfMeasurementRules",
                newName: "id");

            migrationBuilder.AlterColumn<decimal>(
                name: "frontValue",
                table: "UnitOfMeasurementRules",
                type: "decimal(18,2)",
                nullable: true,
                oldClrType: typeof(decimal),
                oldType: "decimal(18,2)");

            migrationBuilder.AlterColumn<decimal>(
                name: "alertValue",
                table: "UnitOfMeasurementRules",
                type: "decimal(18,2)",
                nullable: true,
                oldClrType: typeof(decimal),
                oldType: "decimal(18,2)");

            migrationBuilder.AddColumn<string>(
                name: "Position",
                table: "TReceivingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Position",
                table: "TReceivingOrderDetails");

            migrationBuilder.RenameColumn(
                name: "frontValue",
                table: "UnitOfMeasurementRules",
                newName: "FrontValue");

            migrationBuilder.RenameColumn(
                name: "frontUnitName",
                table: "UnitOfMeasurementRules",
                newName: "FrontUnitName");

            migrationBuilder.RenameColumn(
                name: "frontUnitId",
                table: "UnitOfMeasurementRules",
                newName: "FrontUnitId");

            migrationBuilder.RenameColumn(
                name: "frontUnitCode",
                table: "UnitOfMeasurementRules",
                newName: "FrontUnitCode");

            migrationBuilder.RenameColumn(
                name: "alertValue",
                table: "UnitOfMeasurementRules",
                newName: "AlertValue");

            migrationBuilder.RenameColumn(
                name: "alertUnitName",
                table: "UnitOfMeasurementRules",
                newName: "AlertUnitName");

            migrationBuilder.RenameColumn(
                name: "alertUnitId",
                table: "UnitOfMeasurementRules",
                newName: "AlertUnitId");

            migrationBuilder.RenameColumn(
                name: "alertUnitCode",
                table: "UnitOfMeasurementRules",
                newName: "AlertUnitCode");

            migrationBuilder.RenameColumn(
                name: "id",
                table: "UnitOfMeasurementRules",
                newName: "Id");

            migrationBuilder.AlterColumn<decimal>(
                name: "FrontValue",
                table: "UnitOfMeasurementRules",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m,
                oldClrType: typeof(decimal),
                oldType: "decimal(18,2)",
                oldNullable: true);

            migrationBuilder.AlterColumn<decimal>(
                name: "AlertValue",
                table: "UnitOfMeasurementRules",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m,
                oldClrType: typeof(decimal),
                oldType: "decimal(18,2)",
                oldNullable: true);
        }
    }
}
